const loadProgress = function (xhr) {
  if (xhr.loaded > xhr.total) {
    this.progress("100.0%");
    return;
  }
  const calcRelProgress = (xhr.loaded / xhr.total) * 100;
  const progress = calcRelProgress.toFixed(1) + "%";
  this.progress(progress);
};

export default loadProgress;
